Skip to content

[CppRest] Add Object and fix modelbase includes#6905

Merged
wing328 merged 7 commits into
swagger-api:masterfrom
NativeInstruments:feature/cpprest_fix_modelbase_includes
Nov 22, 2017
Merged

[CppRest] Add Object and fix modelbase includes#6905
wing328 merged 7 commits into
swagger-api:masterfrom
NativeInstruments:feature/cpprest_fix_modelbase_includes

Conversation

@fvarose

@fvarose fvarose commented Nov 7, 2017

Copy link
Copy Markdown
Contributor

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: 3.0.0 branch for changes related to OpenAPI spec 3.0. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming langauge.

Description of the PR

This PR addresses two issues:

  1. The Object.h header file does not exist, we replace it with ModelBase.h which provides the expected functionality (fix [CPPREST] Arbitrary object type results in a compilation error (missing Object.h) #6512). This was seemingly an early copy and paste mistake that wasn't caught by the PetStore example.
    Edit (14/11/2017): this PR provides a simple implementation of Object, wrapped around web::json::value from casablanca. This fixes [CPPREST] Arbitrary object type results in a compilation error (missing Object.h) #6512.
  2. Fixed some relative include paths, to prevent clashes during linking when using two separate APIs that generate identical file names.

I've updated the sample code accordingly and managed to compile it without any problems.
This change has also been tested successfully on a codebase where two separate APIs coexist (which wasn't possible at all before).

@fvarose

fvarose commented Nov 7, 2017

Copy link
Copy Markdown
Contributor Author

cc @stkrwork @ravinikam

@fvarose

fvarose commented Nov 8, 2017

Copy link
Copy Markdown
Contributor Author

Update: I've had a second look and this actually doesn't solve the issue mentioned in #6512..
I will need to revise this by creating an actual Object class that derives from ModelBase and implements the virtual conversion functions.

@fvarose fvarose changed the title [CppRest] fix modelbase includes [CppRest] Add Object and fix modelbase includes Nov 14, 2017
@fvarose

fvarose commented Nov 14, 2017

Copy link
Copy Markdown
Contributor Author

This PR is now ready to be reviewed again. It fixes #6512.
@wing328 @stkrwork @ravinikam

@wing328

wing328 commented Nov 22, 2017

Copy link
Copy Markdown
Contributor

@fvarose thanks for the enhancement.

@stkrwork thanks for reviewing the change.

@wing328 wing328 merged commit acefe3f into swagger-api:master Nov 22, 2017
@murzic4

murzic4 commented Mar 16, 2018

Copy link
Copy Markdown
Contributor

hi all
Im not sure but it looks like types UUID and Number are missing as well

@wing328

wing328 commented Mar 19, 2018

Copy link
Copy Markdown
Contributor

@murzic4 do you mind filing a PR to add those?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CPPREST] Arbitrary object type results in a compilation error (missing Object.h)

4 participants